<template>
	<view class="content">
		<view class="button-demo">
			<u-button @click="openMeiTun()" :ripple="true">美团外卖</u-button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				title: 'Hello'
			}
		},
		onLoad() {
			let that = this;
			
			uni.login({
				provider: 'weixin',
				success: function(loginRes) {
					console.log(loginRes)
					// that.$u.api.wechatLogin({code: loginRes.code}).then(res => {
					// 	uni.setStorageSync('token', res.token)
					// })
					
				}
			});
		},
		methods: {
			openMeiTun(){
				uni.navigateToMiniProgram({
				  appId: 'wxde8ac0a21135c07d',
				  path: "/index/pages/h5/h5?lch=cps:waimai:5:c3e60e5dfec4d5bc23e30254e1ce9ded:7b1175448659019cbe3e386ef5f0e207:2:98634&weburl=https%3A%2F%2Fdpurl.cn%2FLt4bqG4z&f_userId=1&f_token=1",
				  success(res) {
				    // 打开成功
				  },fail(err){
					  console.log(err)
				  }
				})
			}
		}
	}
</script>

<style lang="scss" scoped>
	.content {
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
		padding: 40rpx;
	}

	.logo {
		height: 200rpx;
		width: 200rpx;
		margin-top: 100rpx;
		margin-left: auto;
		margin-right: auto;
		margin-bottom: 50rpx;
	}

	.text-area {
		display: flex;
		justify-content: center;
	}
	
	.title {
		font-size: 28rpx;
		color: $u-content-color;
	}
	
	.button-demo {
		margin-top: 80rpx;
	}
	
	.link-demo {
		margin-top: 80rpx;
	}
</style>
